<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>跳动的心</title>
    <style>
        *{
            margin: 0; /* 清空外边距 */
            padding: 0; /* 清空内边距 */
        }
        /* 让容器 html,body 的高度和宽度都充满全屏 */
        html,body{
            width: 100%;
            height: 100%;
        }
        body{
            background-color: pink; /* 设置整个页面的背景颜色 */
            display: flex; /*  */
            flex-direction: row;  /*  */
            align-items: center;  /* 水平方向居中 */
            justify-content: center; /* 垂直方向居中 */

        }
        .heart{
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            transform: rotate(45deg); /* 将整个心型旋转45度 */
            animation: heartbit 1s alternate infinite; /* 将动画效果添加到 心 上 */
            box-shadow: 0 0 30px red; /* 添加心型边缘的模糊效果*/
        }
        .heart::before{
            content: "";
            width: 200px;
            height: 100px;
            background-color: red;
            position: absolute;
            left: 0;
            top: -99px;
            border-radius: 100px 100px 0 0;
            box-shadow: 0 0 30px red; /* 添加心型边缘的模糊效果*/

        }
        .heart::after{
            content: "";
            width: 100px;
            height: 200px;
            background-color: red;
            position: absolute;
            left: -99px;
            top: 0;
            border-radius: 100px 0 0 100px;
            box-shadow: 0 0 30px red; /* 添加心型边缘的模糊效果*/

        }

        /* 实现动画效果，让心跳动起来 */
        @keyframes heartbit{
            0%{
                transform: rotate(45deg) scale(0.6);
            }
            100%{
                transform: rotate(45deg) scale(1.4);
            }
        }

    </style>
</head>
<body>
    <div class="heart"></div>
</body>
</html>